Repository navigation
Return URL and wc-ajax URLs duplicate the subdirectory path on sites installed in a subdirectory (7213) - #4911
Open
Conversation
Dinamiko
requested review from
AlexP11223,
Narek13,
danieldudzic,
mmaymo and
stracker-phil
as code owners
November 30, 2026 14:40
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 🔗 Test this pull request with WordPress Playground What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit 370db2d • Last updated: 2026-11-30T14:41:36.284Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On sites installed in a subdirectory (e.g.
https://example.com/shop/), the return URLs sent to PayPal had the subdirectory twice:/shop/shop/?wc-ajax=ppc-return-url. Buyers coming back from 3D Secure, redirect-based payment methods, re-approval, Fastlane 3D Secure or the free-trial vault flow landed on the wrong URL.WC_AJAX::get_endpoint()already returns a path that includes the subdirectory, and wrapping it inhome_url()added the subdirectory a second time.PR Changes
The five affected call sites now use WordPress core's
WP_Http::make_absolute_url( WC_AJAX::get_endpoint( … ), home_url() ). It takes only the scheme, host and port fromhome_url()and keeps WooCommerce's path, so the subdirectory appears once. WooCommerce'swoocommerce_ajax_get_endpointfilter is still applied. Sites installed at the domain root are unaffected.